import { useAppStore, useAppStoreWithOut, usePermissionStore, usePermissionStoreWithOut, useUserStore,
  useUserStoreWithOut, useDictStore, useDictStoreWithOut, useTagsViewStore, useTagsViewStoreWithOut, dictFormatter } from 'fssc-template'
import store, { piniaStore } from './pinia-store';
import { dictEnum } from '../constant/enum'




piniaStore.use((context) => {
  const { store } = context;
  if (store.$id === 'dict') {
    // 添加字典请求函数，传入code，对应在使用dict-select或者dict-label组件时的remoteName
    // store.requestDictFun1

    // 添加静态字典
    Object.keys(dictEnum).forEach((key) => {
      store.addDict(key, dictEnum[key])
    })
  }
});

export {
  useAppStore,
  useAppStoreWithOut,
  usePermissionStore,
  usePermissionStoreWithOut,
  useUserStore,
  useUserStoreWithOut,
  useDictStore,
  useDictStoreWithOut,
  useTagsViewStore,
  useTagsViewStoreWithOut,
  piniaStore,
  dictFormatter
}

export default store
